package com.amit.hibernate;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;

public class Lab15Client {

	public static void main(String[] args) {
		
		SessionFactory sessionfactory=ChibernateUtil.getfactory();
		Session session=sessionfactory.openSession();
		Transaction tx=session.beginTransaction();
		Student stu=new Student("amit","amityadav@gmail.com","222");
		session.save(stu);
	
		
		Address add=new Address("sss", "lko", "AP");
		session.save(add);
		stu.setAddress(add);
		tx.commit();
	    session.close();
		
	
	}

}
